import time
setGlobalDuration(30)

beginPythonInst(1)
soundfont(duration=2)
endPythonInst()

proc = startCsound()

scl = scale('C')

rnd = repeater(20,40)

time.sleep(1)

def pit():
    dict = {'soundfont': {}}
    dict['soundfont']['midipitch'] = scl[rnd.next()]
    sendEvent(1, dict, proc)

ti1 = pattern(.125, pit)
ti1.start()
ti1.play()



